package qsc.datastructure.tree.AVLtree;

import qsc.datastructure.tree.Node;

/**
 * @auther QiuShangcheng
 * @create 2021/5/11
 */
public class Client {
    public static void main(String[] args) {
//        int[] arr = {4,3,6,5,7,8};
//        int[] arr = { 10, 12, 8, 9, 7, 6 };
        int[] arr = {10, 11, 7, 6, 8, 9};
        Node root = new Node();
        AVLTree avlTree = new AVLTree(root);
        for (int i = 0; i < arr.length; i++) {
            Node node = new Node(arr[i]);
            root.addToAVLTree(node);
        }
        System.out.println("中序遍历");
        root.infixOrder();
        System.out.println("高度："+root.height());
        System.out.println("左子树高度："+root.leftHeight());
        System.out.println("右子树高度："+root.rightHeight());

    }
}
